unit Unit2;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Data.DBXDataSnap, Data.DBXCommon,
  IPPeerClient, Data.DB, Data.SqlExpr, Datasnap.DBClient, Datasnap.DSConnect,
  Vcl.Grids, Vcl.DBGrids, Vcl.StdCtrls;

type
  TForm2 = class(TForm)
    SQLConnection1: TSQLConnection;
    DSProviderConnection1: TDSProviderConnection;
    ClientDataSet1: TClientDataSet;
    DataSource1: TDataSource;
    DBGrid1: TDBGrid;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    Button5: TButton;
    Button6: TButton;
    Button7: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure Button6Click(Sender: TObject);
    procedure Button7Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

uses Unit3;

procedure TForm2.Button1Click(Sender: TObject);
begin
SQLConnection1.Open;
end;

procedure TForm2.Button2Click(Sender: TObject);
begin
SQLConnection1.Close;
end;

procedure TForm2.Button3Click(Sender: TObject);
begin
ClientDataSet1.Active:=True;
end;

procedure TForm2.Button4Click(Sender: TObject);
begin
if ClientDataSet1.ChangeCount>0 then
  ClientDataSet1.ApplyUpdates(-1);
end;

procedure TForm2.Button5Click(Sender: TObject);
begin
ClientDataSet1.Active:=False;
end;

procedure TForm2.Button6Click(Sender: TObject);
var
Server: TServerMethods1Client;
begin
Server := TServerMethods1Client.Create(SQLConnection1.DBXConnection);
try
ShowMessage(Server.EchoString('Hello Test.'))
finally
Server.Free
end;
end;

procedure TForm2.Button7Click(Sender: TObject);
var
Server: TServerMethods1Client;
begin
Server := TServerMethods1Client.Create(SQLConnection1.DBXConnection);
try
ShowMessage(Server.ReverseString('Hello Test.'))
finally
Server.Free
end;
end;

end.
